package pl.org.lutra.planner.gui.table;

import javax.swing.DefaultCellEditor;
import javax.swing.JTextField;
import javax.swing.text.AbstractDocument;
import javax.swing.text.DocumentFilter;

public class FloatTableCellEditor extends DefaultCellEditor {
    private static final long serialVersionUID = -1118881587053663506L;
    
    public FloatTableCellEditor(DocumentFilter documentFilter) {
        super(new JTextField());
        
        JTextField textField = (JTextField) getComponent();
        AbstractDocument document = (AbstractDocument) textField.getDocument();
        
        document.setDocumentFilter(documentFilter);
    }
}
